package com.uzai.console.enums;

/**
 * 群发消息类型
 * @Auther: liuqi
 * @Date: 2021/8/19 11:22
 * @Description:
 */
public enum GroupSendJobSourceEnum {
    PRIVATE_USER(1, "个人微信用户"),
    WORK_USER(2, "企业微信用户"),
    PRIVATE_CONTACTS(3, "个人微信通讯录"),
    WORK_CONTACTS(4, "企业微信通讯录"),
    APP_USER(5, "App通讯录"),
    ;

    private Integer id;
    private String desc;

    GroupSendJobSourceEnum(Integer id, String desc) {
        this.id = id;
        this.desc = desc;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static GroupSendJobSourceEnum getById(Integer id) {
        if (id == null) {
            return null;
        }
        for (GroupSendJobSourceEnum type: GroupSendJobSourceEnum.values()) {
            if (type.getId().intValue() == id.intValue()) {
                return type;
            }
        }
        return null;
    }
}
